$("#selectedCollege").blur(function () {
    let college = $("#selectedCollege").val();
    if (college == "--请选择学院--") {
        return;
    }
    $.ajax({
        url: "../../multistageTandemServlet",
        data: {"selectedCollege": college},
        type: "GET",
        dataType: "json",
        success: function (data) {//将返回的数据显示到标签
            var options = "<option>--请选择专业--</option>";
            for (let i = 0; i < data.length; i++) {
                options += "<option>" + data[i].name + "</option>";
            }
            $("#selectedDepartment").html(options);
        }
    });
});

$("#selectedDepartment").blur(function () {
    let department = $("#selectedDepartment").val();
    if (department == "--请选择年级--") {
        return;
    }
    $.ajax({
        url: "../../multistageTandemServlet",
        data: {"selectedDepartment": department},
        type: "GET",
        dataType: "json",
        success: function (data) {//将返回的数据显示到标签
            var options = "<option>--请选择年级--</option>";
            for (let i = 0; i < data.length; i++) {
                options += "<option>" + data[i].grade + "</option>";
            }
            $("#selectedGrade").html(options);
        }
    });
});

$("#selectedGrade").blur(function () {
    let grade = $("#selectedGrade").val();
    if (grade == "--请选择班级--") {
        return;
    }
    $.ajax({
        url: "../../multistageTandemServlet",
        data: {"selectedGrade": grade},
        type: "GET",
        dataType: "json",
        success: function (data) {
            var options = "<option>--请选择班级--</option>";
            for (let i = 0; i < data.length; i++) {
                options += "<option>" + data[i].name + "</option>";
            }
            $("#selectedClasses").html(options);
        }
    });
});